home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / FS105DEM / SETUPLIB.MS_ / SETUPLIB.bin
Encoding:
Text File  |  1995-04-05  |  5.8 KB  |  166 lines

  1. '*************************************************************************************************
  2. '
  3. ' SETUPLIB.MST
  4. '
  5. ' Companion script for C/C++ SETUPLIB.LIB
  6. '
  7. ' Client must provide a script called START.MST (which is $INCLUDE'd by this script) containing
  8. ' the label SL_START.
  9. '
  10. ' (C) Copyright 1995 by Mark of the Unicorn, Inc.
  11. '
  12. '*************************************************************************************************
  13.  
  14.  
  15. '*************************************************************************************************
  16. ' standard script includes
  17. '*************************************************************************************************
  18. '$INCLUDE 'setupapi.inc'
  19. '$INCLUDE 'msdetect.inc'
  20. '$INCLUDE 'msregdb.inc'
  21.  
  22.  
  23. '*************************************************************************************************
  24. ' resource ids
  25. '
  26. ' NOTE: these are symbolic names for string resources that must be provided in client DLL 
  27. '*************************************************************************************************
  28. CONST ERR_SL_UNKNOWN                    = 1
  29. CONST ERR_SL_NOT_INSTALLED            = 2
  30.  
  31.  
  32. '*************************************************************************************************
  33. ' possible ORable values for the flags parameter of DoMsgBox
  34. '*************************************************************************************************
  35. CONST MB_OKCANCEL                   = 1
  36. CONST MB_ABORTRETRYIGNORE           = 2
  37. CONST MB_YESNOCANCEL                = 3
  38. CONST MB_YESNO                      = 4
  39. CONST MB_RETRYCANCEL                = 5
  40. CONST MB_ICONSTOP                       = 16
  41. CONST MB_ICONQUESTION               = 32
  42. CONST MB_ICONEXCLAMATION            = 48
  43. CONST MB_ICONINFORMATION            = 64
  44.  
  45.  
  46. '*************************************************************************************************
  47. ' standard command ids
  48. '*************************************************************************************************
  49. CONST IDOK                          = 1
  50. CONST IDCANCEL                      = 2
  51. CONST IDABORT                       = 3
  52. CONST IDRETRY                       = 4
  53. CONST IDIGNORE                      = 5
  54. CONST IDYES                         = 6
  55. CONST IDNO                          = 7
  56.  
  57.  
  58. '*************************************************************************************************
  59. ' import procedures from SETUPLIB.DLL
  60. '*************************************************************************************************
  61. DECLARE FUNCTION    sl_Init LIB "SETUPLIB.DLL" (hwnd%, pszSrcPath$) AS INTEGER
  62. DECLARE SUB            sl_Uninit LIB "SETUPLIB.DLL"
  63. DECLARE FUNCTION    sl_MessageBox LIB "SETUPLIB.DLL" (pszMsg$, uFlags%) AS INTEGER
  64. DECLARE FUNCTION    sl_MessageBoxFromId LIB "SETUPLIB.DLL" (uMsgId%, uFlags%) AS INTEGER
  65. DECLARE FUNCTION    sl_MessageBoxFormatFromId_s LIB "SETUPLIB.DLL" (uFmtId%, psz1$, uFlags%) AS INTEGER
  66. DECLARE SUB         sl_RememberSpawnedWindow LIB "setuplib.dll"
  67. DECLARE SUB         sl_ShowHelpTopic LIB "setuplib.dll" (pszHelpFileSpec$, uContextID%)
  68.  
  69. DECLARE SUB            sl_DebugString LIB "SETUPLIB.DLL" (psz$)
  70.  
  71.  
  72. '*************************************************************************************************
  73. '
  74. ' INIT
  75. '
  76. ' NOTE: This is the main entry point of script soley because it is the first label appear in it!
  77. '
  78. '*************************************************************************************************
  79. INIT:
  80.     GOSUB SL_STARTUP
  81.     GOTO SL_START
  82.  
  83.  
  84. '*************************************************************************************************
  85. SL_STARTUP:
  86.     ' initialize the setup library...
  87.     Result% = sl_Init(HwndFrame(), GetSymbolValue("STF_SRCDIR"))
  88.     IF Result = 0 THEN
  89.         GOTO SL_FAIL
  90.     END IF
  91.     RETURN
  92.  
  93.  
  94. '*************************************************************************************************
  95. SL_SHUTDOWN:
  96.     ' shutdown the setup library
  97.     sl_Uninit
  98.     RETURN
  99.  
  100.  
  101. '*************************************************************************************************
  102. '
  103. ' SL_FAIL
  104. '
  105. '*************************************************************************************************
  106. SL_FAIL:
  107.     NotUsed% = sl_MessageBoxFromId(ERR_SL_UNKNOWN, MB_OK + MB_ICONSTOP + MB_TASKMODAL)
  108.     GOTO SL_END
  109.  
  110.  
  111. '*************************************************************************************************
  112. '
  113. ' SL_QUERY_QUIT
  114. '
  115. ' NOTE: Returns if user decides not to quit; otherwise, does not return and quits the script.
  116. '
  117. '*************************************************************************************************
  118. SL_QUERY_QUIT:
  119.     Result% = sl_MessageBoxFromId(ERR_SL_NOT_INSTALLED, MB_YESNO + MB_ICONQUESTION + MB_TASKMODAL)
  120.  
  121.     IF Result% = IDYES THEN
  122.         GOTO SL_END
  123.     ELSE
  124.         RETURN
  125.     END IF
  126.  
  127.  
  128. '*************************************************************************************************
  129. ' start client script here
  130. '
  131. ' NOTE: Client script must contain SL_START and eventually goto SL_END, SL_FAIL or SL_QUERY_QUIT
  132. ' to properly exit.
  133. '
  134. ' Also, the client's SL_START routine should set the following symbols:
  135. '
  136. '               SYM_SL_SETUP_TITLE
  137. '                     SYM_SL_NEEDS_CTL3D    (actually, can be set any time before SL_END)
  138. '
  139. '*************************************************************************************************
  140. '$INCLUDE 'start.mst'
  141.  
  142.  
  143. '*************************************************************************************************
  144. '
  145. ' QUIT
  146. '
  147. ' NOTE: This label is included solely because the standard headers GOTO it if their error
  148. ' handling decides to abort.
  149. '
  150. '*************************************************************************************************
  151. QUIT:
  152.     GOTO SL_END
  153.  
  154.  
  155. '*************************************************************************************************
  156. '
  157. ' SL_END
  158. '
  159. ' Called by client script at some point after SL_START is called by this script
  160. '
  161. '*************************************************************************************************
  162. SL_END:
  163.     UIPopAll
  164.     GOSUB SL_SHUTDOWN
  165.  
  166.